#pragma once

/*---------------------------------------------------------------------------*/
/*                                Image Data                                 */
/*---------------------------------------------------------------------------*/

#define IMG_PIECE_W 15
#define IMG_PIECE_H 15
#define IMG_QUARTO_ID_MAX 16

PROGMEM static const uint8_t imgPiece[IMG_QUARTO_ID_MAX][30] = { // 15x15 x16
    {
        0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
        0x00, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x00
    },{
        0x00, 0xFF, 0xFF, 0xFF, 0xEF, 0xC7, 0xC7, 0xC7, 0xC7, 0xC7, 0xEF, 0xFF, 0xFF, 0xFF, 0x00,
        0x00, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x00
    },{
        0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0x00,
        0x00, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x00
    },{
        0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x70, 0x70, 0x70, 0x70, 0x70, 0xF0, 0xF0, 0xF0, 0xF0, 0x00,
        0x00, 0x5F, 0x5F, 0x5F, 0x5E, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x5E, 0x5F, 0x5F, 0x5F, 0x00
    },{
        0xB8, 0x7C, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE, 0x7C, 0xB8,
        0x0F, 0x1F, 0x3E, 0x3E, 0x3E, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x3E, 0x3E, 0x3E, 0x1F, 0x0F
    },{
        0xB8, 0x7C, 0xFE, 0xFE, 0xEE, 0xC7, 0xC7, 0xC7, 0xC7, 0xC7, 0xEE, 0xFE, 0xFE, 0x7C, 0xB8,
        0x0F, 0x1F, 0x3E, 0x3E, 0x3E, 0x7D, 0x7D, 0x7D, 0x7D, 0x7D, 0x3E, 0x3E, 0x3E, 0x1F, 0x0F
    },{
        0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80,
        0x0B, 0x17, 0x2F, 0x2F, 0x2F, 0x5F, 0x5F, 0x5F, 0x5F, 0x5F, 0x2F, 0x2F, 0x2F, 0x17, 0x0B
    },{
        0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0x70, 0x70, 0x70, 0x70, 0x70, 0xE0, 0xE0, 0xE0, 0xC0, 0x80,
        0x0B, 0x17, 0x2F, 0x2F, 0x2E, 0x5C, 0x5C, 0x5C, 0x5C, 0x5C, 0x2E, 0x2F, 0x2F, 0x17, 0x0B
    },{
        0x00, 0xFF, 0xAB, 0x55, 0xAB, 0x55, 0xAB, 0x55, 0xAB, 0x55, 0xAB, 0x55, 0xAB, 0xFF, 0x00,
        0x00, 0x7D, 0x69, 0x55, 0x69, 0x55, 0x69, 0x55, 0x69, 0x55, 0x69, 0x55, 0x69, 0x7D, 0x00
    },{
        0x00, 0xFF, 0xAB, 0x55, 0xAB, 0x45, 0x83, 0x45, 0x83, 0x45, 0xAB, 0x55, 0xAB, 0xFF, 0x00,
        0x00, 0x7D, 0x69, 0x55, 0x69, 0x55, 0x69, 0x55, 0x69, 0x55, 0x69, 0x55, 0x69, 0x7D, 0x00
    },{
        0x00, 0xF0, 0xB0, 0x50, 0xB0, 0x50, 0xB0, 0x50, 0xB0, 0x50, 0xB0, 0x50, 0xB0, 0xF0, 0x00,
        0x00, 0x5F, 0x5A, 0x55, 0x5A, 0x55, 0x5A, 0x55, 0x5A, 0x55, 0x5A, 0x55, 0x5A, 0x5F, 0x00
    },{
        0x00, 0xF0, 0xB0, 0x50, 0xB0, 0x50, 0x30, 0x50, 0x30, 0x50, 0xB0, 0x50, 0xB0, 0xF0, 0x00,
        0x00, 0x5F, 0x5A, 0x55, 0x5A, 0x54, 0x58, 0x54, 0x58, 0x54, 0x5A, 0x55, 0x5A, 0x5F, 0x00
    },{
        0xB8, 0x54, 0xAA, 0xD6, 0xAA, 0x55, 0xAB, 0x55, 0xAB, 0x55, 0xAA, 0xD6, 0xAA, 0x54, 0xB8,
        0x0F, 0x15, 0x2A, 0x34, 0x2A, 0x55, 0x69, 0x55, 0x69, 0x55, 0x2A, 0x34, 0x2A, 0x15, 0x0F
    },{
        0xB8, 0x54, 0xAA, 0xD6, 0xAA, 0x45, 0x83, 0x45, 0x83, 0x45, 0xAA, 0xD6, 0xAA, 0x54, 0xB8,
        0x0F, 0x15, 0x2A, 0x34, 0x2A, 0x55, 0x69, 0x55, 0x69, 0x55, 0x2A, 0x34, 0x2A, 0x15, 0x0F
    },{
        0x80, 0x40, 0xA0, 0x60, 0xA0, 0x50, 0xB0, 0x50, 0xB0, 0x50, 0xA0, 0x60, 0xA0, 0x40, 0x80,
        0x0B, 0x15, 0x2A, 0x2D, 0x2A, 0x55, 0x5A, 0x55, 0x5A, 0x55, 0x2A, 0x2D, 0x2A, 0x15, 0x0B
    },{
        0x80, 0x40, 0xA0, 0x60, 0xA0, 0x50, 0x30, 0x50, 0x30, 0x50, 0xA0, 0x60, 0xA0, 0x40, 0x80,
        0x0B, 0x15, 0x2A, 0x2D, 0x2A, 0x54, 0x58, 0x54, 0x58, 0x54, 0x2A, 0x2D, 0x2A, 0x15, 0x0B
    }
};

#define IMG_CURSOR_W 15
#define IMG_CURSOR_H 15

PROGMEM static const uint8_t imgCursor[2][32] = { // 16x16 x2
    {
        0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F,
        0x7C, 0x78, 0x70, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x70, 0x78, 0x7C
    },{
        0x00, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00,
        0x00, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x00
    }
};

#define IMG_PLAYER_W 11
#define IMG_PLAYER_H 11

PROGMEM static const uint8_t imgPlayer[2][22] = { // 11x11 x2
    { 0x00, 0x00, 0x1C, 0xA2, 0x41, 0x01, 0x41, 0xA2, 0x1C, 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x06, 0x00 },
    { 0x54, 0xFE, 0x03, 0x02, 0x03, 0x02, 0x03, 0x02, 0x03, 0xFE, 0x54, 0x01, 0x03, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x03, 0x01 },
};

#define IMG_HINT_WIN_W 5
#define IMG_HINT_WIN_H 5

PROGMEM static const uint8_t imgHintWin[5] = { 0x04, 0x0A, 0x11, 0x0A, 0x04 }; // 5x5

/*---------------------------------------------------------------------------*/
/*                                Sound Data                                 */
/*---------------------------------------------------------------------------*/

enum {
    SND_PRIO_START = 0,
    SND_PRIO_RESULT,
    SND_PRIO_CANCEL,
    SND_PRIO_PLACE,
};

PROGMEM static const byte soundStart[] = {
    0x90, 72, 0, 100, 0x90, 74, 0, 100, 0x90, 76, 0, 100,
    0x90, 77, 0, 100, 0x90, 79, 0, 200, 0x80, 0xF0
};

PROGMEM static const byte soundPlace[] = {
    0x90, 55, 0, 6, 0x90, 58, 0, 6, 0x90, 52, 0, 6, 0x90, 49, 0, 6,
    0x90, 55, 0, 6, 0x90, 58, 0, 6, 0x90, 52, 0, 6, 0x90, 49, 0, 6, 0x80, 0xF0
};

PROGMEM static const byte soundCancel[] = {
    0x90, 72, 0, 40, 0x90, 69, 0, 40, 0x90, 65, 0, 40, 0x80, 0xF0
};

PROGMEM static const byte soundWin[] = {
    0x90, 81, 0, 40, 0x80, 0, 40, 0x90, 86, 0, 40, 0x80, 0, 40, 0x90, 90, 0, 40, 0x80, 0, 40, 0xE0
};

PROGMEM static const byte soundDraw[] = {
    0x90, 60, 0, 64, 0x80, 0, 64, 0xE0
};

PROGMEM static const byte soundLose[] = {
    0x90, 55, 0, 120, 0x90, 54, 0, 140, 0x90, 53, 0, 160, 0x90, 52, 0, 180,
    0x90, 51, 0, 200, 0x90, 50, 0, 220, 0x90, 49, 0, 240, 0x90, 48, 0, 260, 0x80, 0xF0
};
